package com.szrt.java.day20161226.demo02;

public class FunctionDemoBase {

	public static void main(String[] args) {
		int sum = sum(10);
		System.out.println("1加到10等于："+sum);
		
		int sumAdd = add(333,333);
		System.out.println(sumAdd);
	}
	
	public static int sum(int a){
		int sum = 0;
		
		for(int i=1;i<=a;i++){
			sum = sum + i;
		}
		return sum;
	}
	
	public static int add(int a,int b){
		int sum = 0;
		sum = a + b;
		
		return sum;
	}
}
